<template>
  <div>
    <button @click="handleGlobal">获取地理位置</button>
  </div>
</template>

<script setup>
const handleGlobal=function(){
  if ( "geolocation" in navigator ) {
		// 浏览器支持获取地理位置
    const successCallback = (location) => {
			console.log("获取到的地理位置：", location)
      console.log(11);
		}
		navigator.geolocation.watchPosition(
			successCallback
		)
	} else {
		// 浏览器不支持获取地理位置
    console.log(22);
	}

}





</script>